package com.example.mine_platform.mapper;

import com.example.mine_platform.pojo.entities.ProductionUser;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;

public interface ProductionUserMapper extends Mapper<ProductionUser> {
    @Results(id="productionUserResultMap", value={
            @Result(property="id", column="id"),
            @Result(property="userId", column="user_id"),
            @Result(property="productionId", column="production_id"),
            @Result(property="createTime", column="create_time"),
            @Result(property="updateTime", column="update_time"),
            @Result(property="deleted", column="deleted")
    })
    @Select("select * from production_user where deleted=0 and production_id=#{id}")
    public List<ProductionUser> getAllUsersById(Integer id);
}